<include file="Public/min-header"/>
<div class="wrapper">
    <include file="Public/breadcrumb"/>
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <!--<nav class="navbar navbar-default">
                     <div class="collapse navbar-collapse">
                         <div class="navbar-form pull-right margin">
                               <if condition="$order['order_status'] lt 2">
                                  <a href="{:U('Admin/order/edit_order',array('order_id'=>$order['order_id']))}" data-toggle="tooltip" title="" class="btn btn-primary" data-original-title="编辑">修改订单</a>
                               </if>
                               <if condition="($split eq 1) and ($order['order_status'] lt 2)">
                                  <a href="{:U('Admin/order/split_order',array('order_id'=>$order['order_id']))}" data-toggle="tooltip" title="" class="btn btn-primary" data-original-title="编辑">拆分订单</a>
                               </if>
                               <a href="{:U('Order/order_print',array('order_id'=>$order['order_id']))}" target="_blank" data-toggle="tooltip" title="" class="btn btn-primary" data-original-title="打印订单">
                                  <i class="fa fa-print"></i>打印订单
                               </a>
                               <a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default" data-original-title="返回"><i class="fa fa-reply"></i></a>
                        </div>
                     </div>
                    </nav>-->

                    <!--新订单列表 基本信息-->
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title text-center">基本信息</h3>
                        </div>
                        <div class="panel-body">
                            <table class="table table-bordered">
                                <tbody>
                                <tr>
                                    <td>ID:</td>
                                    <td>姓名:</td>
                                    <td>电话:</td>
                                    <td>邮箱:</td>
                                    <td>类型:</td>
                                    <td>QQ:</td>
                                    <td>状态:</td>
                                    <td>添加时间:</td>
                                    <td>业务员:</td>
                                </tr>
                                <tr>
                                    <td>{$info.id}</td>
                                    <td>{$info.name}</td>
                                    <td>{$info.mobile}</td>
                                    <td>{$info.email}</td>
                                    <td>
                                        <if condition="$info[xtype] eq 1">买店<else/>卖店</if>
                                        <if condition="$info[selltype] eq 3">/天猫<elseif condition="$info[selltype] eq 4"/>/淘宝<elseif condition="$info[selltype] eq 5"/>/京东<elseif condition="$info[selltype] eq 6"/>/其他</if>
                                    </td>
                                    <td>{$info.qqnum}</td>
                                    <td><if condition="$info[status] eq 0">待处理<else/>已处理</if></td>
                                    <td>{$info.add_time|date='Y-m-d H:i',###} </td>
                                    <!--<td>{$info.admin_id}</td>-->
                                    <td >
                                        {$info.admin_id|get_sales_name}
                                        <if condition="$info[admin_id] eq ''"><button type="button" onclick="fenpei_admin({$info.id})">分配</button></if>
                                    </td>

                                </tr>

                                </tbody>
                            </table>
                        </div>
                    </div>

                    <script>
                        function fenpei_admin(id){
                            var url = '/index.php?m=Admin&c=Askbuy&a=fenpei_admin&id='+id;
                            layer.open({
                                type: 2,
                                title: '分配业务员',
                                shadeClose: true,
                                shade: 0.3,
                                area: ['800px', '400px'],
                                content: url,
                            });

                        }
                    </script>


                    <!--新订单列表 操作信息-->
                    <div class="panel panel-default">
                         <div class="panel-heading">
                            <h3 class="panel-title text-center">留言内容</h3>
                        </div>
                        <div class="panel-body">
                            <table class="table table-bordered">
                                <tbody>
                                <tr>
                                    <div class="row">
                                        <!--<td class="text-right col-sm-2"><p class="margin">留言内容：</p></td>-->
                                        <td colspan="3">
                                            <form id="order-action">
                                                <textarea name="note"  readonly rows="3" class="form-control">{$info.content}</textarea>
                                            </form>
                                        </td>
                                    </div>
                                </tr>

                                </tbody>
                            </table>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </section>
</div>
</body>
<script>
    function pay_cancel(obj){
        var url =  $(obj).attr('data-url')+'/'+Math.random();

        layer.open({
            type: 2,
            title: '退款操作',
            shadeClose: true,
            shade: 0.8,
            area: ['45%', '50%'],
            content: url,
        });
    }
    //取消付款
    function pay_callback(s){
        if(s==1){
            layer.msg('操作成功', {icon: 1});
            layer.closeAll('iframe');
            location.href =	location.href;
        }else{
            layer.msg('操作失败', {icon: 3});
            layer.closeAll('iframe');
            location.href =	location.href;
        }
    }

    // 弹出退换货商品
    function selectGoods2(order_id){
        var url = "/index.php?m=Admin&c=Order&a=get_order_goods&order_id="+order_id;
        layer.open({
            type: 2,
            title: '选择商品',
            shadeClose: true,
            shade: 0.8,
            area: ['60%', '60%'],
            content: url,
        });
    }
    // 申请退换货
    function call_back(order_id,goods_id)
    {
        var url = "/index.php?m=Admin&c=Order&a=add_return_goods&order_id="+order_id+"&goods_id="+goods_id;
        location.href = url;
    }
</script>
</html>